package com.zkt.subject.infra.rpc;

import com.zkt.recommend.api.RecommendFeignService;
import com.zkt.recommend.entity.RecommendUserPortraitDTO;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 赵开泰
 * @program jc-club
 * @date 2025/3/29
 * @description 推荐服务调用
 **/

@Component
public class RecommendRPC {
	
	@Resource
	private RecommendFeignService recommendFeignService;
	
	
	public void removeUserPortrait(Long userId, List<Long> labelIds) {
		if (userId == null || labelIds == null || labelIds.isEmpty()) {
			return;
		}
		
		labelIds.forEach(labelId -> {
			RecommendUserPortraitDTO recommendUserPortraitDTO = new RecommendUserPortraitDTO();
			recommendUserPortraitDTO.setUserId(userId);
			recommendUserPortraitDTO.setLabelId(labelId);
			
			recommendFeignService.remove(recommendUserPortraitDTO);
		});
	}
}